<h1>New comment</h1>

<% form_for Comment.new, :url => comments_path( @project.name, @issue.local_id ),
                         :html => { :multipart => true } do |form| -%>
  <%= form.error_messages %>
  <p>
    <%= form.label :summary %>
    <%= form.text_field :summary %>
  </p>
  <p>
    <%= form.label :details %>
    <%= form.text_area :details %>
  </p>
  <p>
    <%= label :issue, :status %>
    <%= text_field :issue, :status, :value => issue.status.name %>
    <div id="status_choices" class="autocomplete"></div>
    <%= auto_complete_field 'issue_status',
          :url => autocomplete_status_url,
          :update => 'status_choices',
          :param_name => 'match' %>
  </p>
  <p>
    <%= label :issue, :priority %>
    <%= text_field :issue, :priority, :value => issue.priority.name %>
    <div id="priority_choices" class="autocomplete"></div>
    <%= auto_complete_field 'issue_priority',
          :url => autocomplete_priority_url,
          :update => 'priority_choices',
          :param_name => 'match' %>
  </p>
  <p>
    <%= label :issue, :tag_list, 'Tags' %>
    <%= text_field :issue, :tag_list, :value => issue.tag_list.to_s %>
  </p>
  <%= render :partial => 'shared/attach' %>
  <%= form.submit 'Post Comment' %>
<% end -%>

<%= link_to 'Back', comments_path %>
